dataSource {
    pooled = true
    driverClassName = "com.mysql.jdbc.Driver"//"org.h2.Driver" //
    username = "sa"
    password = ""
    properties {
        maxActive = 50
        maxIdle = 25
        minIdle = 5
        initialSize = 5
        minEvictableIdleTimeMillis = 60000
        timeBetweenEvictionRunsMillis = 60000
        maxWait = 10000
        validationQuery = "/* ping */"
    }
}
hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = false
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings

//def serverURL = "192.168.173.192" //VM PERSO
//def serverURL = "195.154.74.28"
//def serverURL = "10.50.64.46" //VM EXTERNE
def serverURL = "127.0.0.1" //LOCAL
environments {
    development {
        dataSource {
            dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
            //url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
//            url = "jdbc:mysql://" + serverURL + ":3306/M-PDS-DEV"
            url = "jdbc:mysql://" + serverURL + ":3306/mbds-first"
//            username = "firstprojectmpds"
//            password = "firstprojectmpds20142015"
            username = "admin_first"
            password = "admin_first"
        }
    }
    test {
        dataSource {
            dbCreate = "create"
            url = "jdbc:mysql://" + serverURL + ":3306/M-PDS_TEST"
            username = "admin"
            password = "admin"
        }
    }
    production {
        dataSource {
            dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
            //url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
            //url = "jdbc:mysql://flatbrains.com:3306/M-PDS-PROD"
             url = "jdbc:mysql://" + serverURL + ":3306/M-PDS-PROD"
            username = "firstprojectmpds"
            password = "firstprojectmpds20142015"

            pooled = true
            properties {
                maxActive = 100
                minEvictableIdleTimeMillis = 1800000
                timeBetweenEvictionRunsMillis = 1800000
                numTestsPerEvictionRun = 3
                testOnBorrow = true
                testWhileIdle = true
                testOnReturn = true
                validationQuery = "SELECT 1"
            }

        }
    }
}
